#ifndef DECKLINKCAPTUREDELEGATE_H
#define DECKLINKCAPTUREDELEGATE_H

#include <DeckLinkAPI.h>

class DeckLinkCaptureDelegate : public IDeckLinkInputCallback
{
public:
    DeckLinkCaptureDelegate();
    ~DeckLinkCaptureDelegate();

    virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; }
    virtual ULONG STDMETHODCALLTYPE AddRef(void);
    virtual ULONG STDMETHODCALLTYPE  Release(void);
    virtual HRESULT STDMETHODCALLTYPE VideoInputFormatChanged(BMDVideoInputFormatChangedEvents, IDeckLinkDisplayMode*, BMDDetectedVideoInputFormatFlags);
    virtual HRESULT STDMETHODCALLTYPE VideoInputFrameArrived(IDeckLinkVideoInputFrame*, IDeckLinkAudioInputPacket*);

    void setChannel(int channel);

private:
    ULONG				m_refCount;
    pthread_mutex_t		m_mutex;
    int channelNumber;
    unsigned long frameCount;
    char fileprefix[1024];
};

#endif // DECKLINKCAPTUREDELEGATE_H
